fix(frontend): drop stale attribute references when an operator's input schema changes#5294
Merged
kunwp1 merged 4 commits intoMay 30, 2026
Conversation
…ange Copy-pasting a schema-propagated Aggregate (or any operator with @AutofillAttributeName/@AutofillAttributeNameList properties) and wiring it to a different upstream left property values referencing columns that no longer exist in the new input schema. This caused a compile error that persisted even after clearing properties, since invalid values were never removed. When schema propagation produces an authoritative input-attribute list, WorkflowCompilingService now drops property values that the new schema invalidates: single attribute references are reset and attribute lists are filtered. This honors the contract previously only documented on DynamicSchemaService.setDynamicSchema. Resolves apache#3070.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5294 +/- ##
============================================
+ Coverage 49.16% 49.39% +0.23%
Complexity 2384 2384
============================================
Files 1051 1051
Lines 40350 40388 +38
Branches 4279 4292 +13
============================================
+ Hits 19837 19949 +112
+ Misses 19353 19261 -92
- Partials 1160 1178 +18
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Add a TestBed integration test driving applySchemaPropagationResult so the getOperator/dropInvalidAttributeValues/setOperatorProperty path is exercised (both the changed and unchanged branches), plus helper tests for the non-object/nullish guard and the absent-property branch.
Contributor
Author
|
/request-review @bobbai00 |
bobbai00
approved these changes
May 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this PR?
Fixes a bug where copy-pasting a schema-propagated Aggregate operator and connecting it to a different upstream operator caused a compile error that persisted even after clearing all properties.
Why it is a bug: An Aggregate stores property values that reference input column names —
groupByKeysandaggregations[].attribute. Copy-paste clonesoperatorProperties, so the pasted operator keeps references to the old source's columns. When it is wired to a different operator, the backendAggregateOpDescschema propagation callsinputSchema.getAttribute("<old col>"), which throws. These old column values were never removed.DynamicSchemaService.setDynamicSchemais documented to drop properties invalidated by a new schema, but the code never actually did it.What changed: When schema propagation produces an input-attribute list,
WorkflowCompilingServicenow drops property values that the new schema invalidates via a new pure helperdropInvalidAttributeValues:autofill: "attributeName"-> reset to""if not in the enumautofill: "attributeNameList"-> filter out entries not in the enumaggregations[].attributeis handled) and never mutates the inputThe misleading doc comment on
setDynamicSchemanow points to where the contract is fulfilled.Any related issues, documentation, discussions?
Resolves #3070.
How was this PR tested?
Manually tested:
Screen.Recording.2026-05-29.at.4.58.05.PM.mov
Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 4.8)